.sp 1i

.PP
One important property shared by the above examples is that
they can all be thought of as filters.
The first example can be thought of as an addition filter,
i.e.  it takes
two streams of inputs and produces the stream of their sums.
The following seqeunce of snapshots of the dataflow
computation:

.IB
   |   |         |   |         |   |         |   |
 2 |   | 3       |   |       1 |   | ~8  2.73|   | 1
   V   V         V   V         V   V         V   V
 +-+---+-+     +-+---+-+     +-+---+-+     +-+---+-+
 |  plus | ==> |  plus | ==> |  plus | ==> |  plus | ==> continued
 +---+---+     +---+---+     +---+---+     +---+---+
     |             |  5          |             | ~7
     |             |             |  5          |  5
     V             V             V             V

.IE

note in pLucid negative numbers are prefixed by the symbol ~ as
in ~8 (minus 8).

.IB
   |   |         |   |
   |   |         |   |
   V   V         V   V
 +-+---+-+     +-+---+-+
 |  plus | ==> |  plus | ==> ...... Ad infinitum
 +---+---+     +---+---+
     | 3.73        | 3.73
     | ~7          | ~7
     V 5           V 5

.IE

Similarly the second example is a combination of two filters. The first
called the tail filter,
takes one input stream and produces the
stream of tails. The output of this filter is !piped to the input
of the second filter, namely the head filter. This second filter
produces as its output the heads of the sequence of finite
lists input.
The following is a sequence of snapshots of the computation:

.IB
      |                |                    |
      | [42 7 5]       | [3 [2.4 8] 9]      | [2]
      V                |                    |
   +--+---+         +--+---+             +--+---+
   |  tl  |         |  tl  |             |  tl  |
   +--+---+         +--+---+             +--+---+
      |        ==>     | [7 5]      ==>     | [[2.4 8] 9] ==> continued
      V                V                    V
   +--+---+         +--+---+             +--+---+
   |  hd  |         |  hd  |             |  hd  |
   +--+---+         +--+---+             +--+---+
      |                |                    | 7
      V                V                    V
      |                |                    |
.IE
